<template>
 <div class="yingmoo-media">
   <ym-header></ym-header>
   <ym-medianav></ym-medianav>
   <ym-secondnav></ym-secondnav>
   
<!--  广告轮播  -->
    <div class="ym-lunbo">
      <el-carousel indicator-position="inside">
        <el-carousel-item v-for="(v,i) in banners" :key="i">
          <img :src="v.imgpath" />
        </el-carousel-item>
      </el-carousel>
    </div>
<!--  推荐公交车身媒体  -->
    <div class="yingmoo-template">
      <div class="column-navbar grey">
        <h1 class="column-title">
          <img class="column-icon" src="../assets/ym-index/icon-yun1.png" />
          <span class="column-name">推荐公交车身媒体</span>
          <img class="column-arrow" src="../assets/ym-index/bg-arrow.png" />
        </h1>
        <p class="column-citys">
          <span>拉手</span>
          <span>椅背</span>
          <span>看板</span>
          <span>电视</span>
          <span>LED显示屏</span>
        </p>
      </div>
      <div class="column-content">
      	<ul>
      		<li class="media-model" style="float: left; margin: 8px" v-for="n in list1">
		        <dl>
		          <dt>
		            <img width="222px" height="198px" :src="n.imgpath" />
		          </dt>
		          <dd class="media-text-first" :title='n.name'>{{n.name}}</dd>
		          <dd class="media-text-secend">￥{{n.price}}</dd>
		          <dd class="media-text-city"><span>{{n.remark}}</span></dd>
		        </dl>      			
      		</li>
      	</ul>
      </div>
    </div>
<!--  最新候车亭媒体  -->
    <div class="yingmoo-template">
      <div class="column-navbar grey">
        <h1 class="column-title">
          <img class="column-icon" src="../assets/ym-index/icon-yun1.png" />
          <span class="column-name">最新候车亭媒体</span>
          <img class="column-arrow" src="../assets/ym-index/bg-arrow.png" />
        </h1>
        <p class="column-citys">
          <span>灯箱</span>
          <span>站牌</span>
          <span>看板</span>
          <span>电视</span>
          <span>LED显示屏</span>
        </p>
      </div>
      <div class="column-content">
      	<ul>
      		<li class="media-model" style="float: left; margin: 8px" v-for="n in list2">
		        <dl>
		          <dt>
		            <img width="222px" height="198px" :src="n.imgpath" />
		          </dt>
		          <dd class="media-text-first" :title='n.name'>{{n.name}}</dd>
		          <dd class="media-text-secend">￥{{n.price}}</dd>
		          <dd class="media-text-city"><span>{{n.remark}}</span></dd>
		        </dl>      			
      		</li>
      	</ul>
      </div>
    </div>
<!--  优秀合作商家  -->
    <div class="yingmoo-column yingmoo-xxx">
      <div class="column-navbar grey">
        <h1 class="column-title">
          <img class="column-icon" src="../assets/ym-index/icon-yun1.png" />
          <span class="column-name">优秀合作商家</span>
          <img class="column-arrow" src="../assets/ym-index/bg-arrow.png" />
        </h1>
      </div>
      <div class="column-content">
        <dl class="media-model" v-for="n in list3">
          <dt>
            <img width="222px" height="198px" :src="n.imgpath" />
          </dt>
          <dd class="media-text-first" :title='n.name'>{{n.name}}</dd>
<!--
          <dd class="media-text-secend">￥{{n.price}}</dd>
          <dd class="media-text-city"><span>{{n.remark}}</span></dd>
-->
        </dl>
      </div>
    </div>
    <ym-footer></ym-footer>
 </div>
</template>
<script>
  import ymHeader from "@/components/ymHeader.vue";
  import ymMedianav from "@/components/ymMedianav.vue";
  import ymFooter from "@/components/ymFooter.vue";
  import ymSecondnav from "@/components/ymSecondnav.vue";
  export default {
    name: "yingmoo-media",
    components: {
      ymHeader,
      ymMedianav,
      ymSecondnav,
      ymFooter
    },
    data() {
      return {
      	requestAddr:this.GLOBAL.addr,
        /* banner数据，方便修改 */
        banners: [{
          imgUrl: require('@/assets/ym-media/lunbo-public.png')
        }, {
          imgUrl: require('@/assets/ym-media/lunbo-public.png')
        }, {
          imgUrl: require('@/assets/ym-media/lunbo-public.png')
        }],
        list1: [],
        list2: [],
        list3: [],
        model: [{
          modeltext: '媒体名称媒体名称媒体名称',
          modelmoney: '价格：120万 元/年',
          modelcity: '北京西站',
          modellook: '看板'
        }, {
          modeltext: '媒体名称媒体名称媒体名称',
          modelmoney: '价格：120万 元/年',
          modelcity: '北京西站',
          modellook: '看板'
        }, {
          modeltext: '媒体名称媒体名称媒体名称',
          modelmoney: '价格：120万 元/年',
          modelcity: '北京西站',
          modellook: '看板'
        }, {
          modeltext: '媒体名称媒体名称媒体名称',
          modelmoney: '价格：120万 元/年',
          modelcity: '北京西站',
          modellook: '看板'
        }, {
          modeltext: '媒体名称媒体名称媒体名称',
          modelmoney: '价格：120万 元/年',
          modelcity: '北京西站',
          modellook: '看板'
        }]

      }
    },
    mounted() {
      this.getList(35, 3); //轮播
      this.getList(36, 10); //公交车身
      this.getList(37, 10); //候车亭
      this.getList(38, 5); //合作商家	
    },
    methods: {
      getList: function(adid, limit) {
        this.$http({
          url: this.requestAddr+'/GetJson/get/adshow?adid=' + adid + "&limit=" + limit,
          method: 'JSONP',
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          },
          jsonp: 'callbackparam'
        }).then(res => {
          /*console.log(res.data);*/
          if (res.data != null) {
            if (adid == 35) {
              this.banners = res.data;
            }
            if (adid == 36) {
              this.list1 = res.data;
            }
            if (adid == 37) {
              this.list2 = res.data;
            }
            if (adid == 38) {
              this.list3 = res.data;
            }
          }
        }).catch()
      }
    }
  }

</script>

<style scoped lang="less">
  .yingmoo-media {
    width: 100%;
    background-color: #f3f9ff;
    .ym-lunbo {
      width: 100%;
      height: 450px;
      position: absolute;
      top: 234px;
      left: 0;
      z-index: 1;
    }
    .yingmoo-template {
      width: 1200px;
      margin: 0 auto;
      margin-top: 30px;
      .column-navbar {
        height: 44px;
        line-height: 44px;
        position: relative;
        &.grey {
          background-color: #e6e6e6;
        }
        .column-title {
          position: absolute;
          left: 0;
          top: 0;
          z-index: 1;
          width: 247px;
          color: #fbb03b;
          font-size: 18px;
          background-color: #036eb7;
          .column-icon {
            margin-left: 26px;
          }
          .column-arrow {
            position: absolute;
            right: -26px;
            top: 0;
          }
        }
        .column-citys {
          line-height: 44px;
          width: 400px;
          background: none;
          color: #999999;
          margin-right: 20px;
          float: right;
          span {
            padding-left: 20px;
            padding-right: 20px;
            font-size: 14px;
          }
        }
      }
      .column-content {
        width: 1200px;
        background-color: transparent;
        clear: both;
        display: flex;
        justify-content: space-between;
        ul {
          .media-model {
            width: 224px;
            height: 291px;
            margin-top: 20px;
            dd {
              background-color: white;
              height: 24px;
              line-height: 24px;
              padding-left: 10px;
            }
            .media-text-first {
              font-size: 15px;
              padding-top: 9px;
              overflow: hidden;
              text-overflow: clip;
            }
            .media-text-secend {
              font-size: 12px;
              color: red;
            }
            .media-text-city {
              font-size: 12px;
              color: #999999;
              padding-bottom: 6px;
            }
          }
        }
      }
    }
    .yingmoo-xxx {
      width: 1200px;
      height: 357px;
      margin: 0 auto;
      background-color: transparent;
      margin-top: 30px;
      .column-navbar {
        height: 44px;
        line-height: 44px;
        position: relative;
        &.grey {
          background-color: #e6e6e6;
        }
        .column-title {
          position: absolute;
          left: 0;
          top: 0;
          z-index: 1;
          width: 247px;
          color: #fbb03b;
          font-size: 18px;
          background-color: #036eb7;
          .column-icon {
            margin-left: 26px;
          }
          .column-arrow {
            position: absolute;
            right: -26px;
            top: 0;
          }
        }
        .column-citys {
          line-height: 44px;
          width: 370px;
          background: none;
          color: #999999;
          margin-right: 30px;
          float: right;
          span {
            padding-left: 20px;
            padding-right: 20px;
            font-size: 14px;
          }
        }
      }
      .column-content {
        width: 1200px;
        background-color: transparent;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        .media-model {
          width: 224px;
          height: 240px;
          margin-top: 20px;
          background-color: white;
          dd {
            background-color: white;
            padding-left: 10px;
          }
          .media-text-first {
            line-height: 40px;
            height: 40px;
            font-size: 14px;
            text-align: center;
            overflow: hidden;
            text-overflow: clip;
          }
          .media-text-secend {
            font-size: 12px;
            color: red;
          }
          .media-text-city {
            font-size: 12px;
            color: #999999;
            padding-bottom: 6px;
          }
        }
      }
    }
  }

</style>
